import React, { useState, useEffect } from 'react';
import {connect} from '../react-redux'
const List = (props) => {
  return (
    <>
      <ul>
        {
          props.todoList.map(item => (<li key={item.id}>{item.text}</li>))
        }
      </ul>
    </>
  )
}
export default connect(
  (state)=>{
    return state['todo']
  },null,
  (stateProps, dispatchProps, ownProps)=>{
    return {...stateProps,...dispatchProps,...ownProps}
  },{
    pure: true, // true 当 store 和 mapStateToProps 相关时才更新
  }
)(List)